﻿Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Workflow.ComponentModel.Compiler
Imports System.Workflow.ComponentModel.Design

Namespace System.Workflow.Activities
    <ActivityDesignerTheme(GetType(WebServiceResponseDesignerTheme))> _
    Friend NotInheritable Class WebServiceResponseDesigner
        Inherits ActivityDesigner
        ' Methods
        Protected Overrides Sub OnActivityChanged(ByVal e As ActivityChangedEventArgs)
            MyBase.OnActivityChanged(e)
            If ((Not e.Member Is Nothing) AndAlso (e.Member.Name = "InputActivityName")) Then
                [TryCast](e.Activity,WebServiceOutputActivity).ParameterBindings.Clear
                TypeDescriptor.Refresh(e.Activity)
            End If
        End Sub

        Protected Overrides Sub PreFilterProperties(ByVal properties As IDictionary)
            MyBase.PreFilterProperties(properties)
            If (DirectCast(MyBase.GetService(GetType(ITypeProvider)), ITypeProvider) Is Nothing) Then
                Throw New InvalidOperationException(SR.GetString("General_MissingService", New Object() { GetType(ITypeProvider).FullName }))
            End If
            [TryCast](MyBase.Activity,WebServiceOutputActivity).GetParameterPropertyDescriptors(properties)
        End Sub

    End Class
End Namespace

